<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



<html>
<script  type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<body>




   账号 <input type="text" id="username">

   密码 <input type="text" id="userpwd">

    <button id="deng" onclick="login()">登录</button>
   <script type="text/javascript">

       function login() {

           var  name1=$('#username').val();
           var  pwd1=$("#userpwd").val();
           alert(name1);

           $.ajax({
               type: "POST",
               url: "user/login",
               dataType:'json',
               data:{
                   "username": name1,
                   "userpwd":pwd1

               },
               success: function (result) {
                   if (result.status==0){


                   }
                   alert("22222")
               alert(result.status)

               },
               error : function(result) {
                   window.location.href="a.jsp"
                   alert("异常！");
               }

           });
       }


   </script>
<a href="a.jsp">aaaa</a>
</body>
</html>
